package com.panda.controller;/**
 * @author 乐于吕
 * * @date 2024/10/22
 */

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 乐于吕
 * @CreateTime: 2024-10-22
 * @Description:
 */

@RestController
@RequestMapping("/sentinel")
public class SentinelController {


    @GetMapping("m1")
    public String method1() {
        long time = System.currentTimeMillis();
        System.out.println("接收到一个请求，处理时间是 ： " + time);
        return "SentinelController    method1    success ";
    }


    @GetMapping("m2")
    public String method2() {
        return "SentinelController    method2    success ";
    }

    @GetMapping("m3")
    public String method3(Integer id) {
        if (id < 1) {
            throw new RuntimeException("参数异常");
        }
        return "SentinelController    method3    success ";
    }

}
